<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 百岁
  Date: 2021/9/15
  Time: 19:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>书籍展示</title>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
          integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
</head>
<body>
<table class="table">
    <caption>
        <a class="btn btn-primary" href="${pageContext.request.contextPath}/book/toAddBook">添加书籍</a>
        <form action="/book/queryByName" method="post">
            <input type="text" name="queryByName" placeholder="请输入要查询的书籍名称" class="form-control">
            <input type="submit" class="btn btn-primary">
            <span style="color: red ;font-weight: bold">${error}</span>
        </form>
    </caption>
    <thead>
    <tr>
        <th>书籍ID</th>
        <th>书籍名称</th>
        <th>书籍数量</th>
        <th>书记描述</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach var="book" items="${list}">
        <tr>
            <td>${book.bookID}</td>
            <td>${book.bookName}</td>
            <td>${book.bookCounts}</td>
            <td>${book.detail}</td>
            <td>
                <a href="${pageContext.request.contextPath}/book/toUpdateBook?id=${book.bookID}">修改</a>
                &nbsp;|&nbsp;
                <a href="${pageContext.request.contextPath}/book/deleteBook/${book.bookID}">删除</a>
            </td>
        </tr>
    </c:forEach>

    </tbody>
</table>
</body>
</html>
